-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
test: deflake test-fs-promises-watch-iterator #60060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
for (const fileName of [...this.files]) { | ||
await writeFile(this.filePath(fileName), Date.now() + fileName.repeat(1e4)); | ||
} | ||
await setTimeout(common.platformTimeout(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there was a reason for this I will add it back, but I don't see it.
// Do the write with a delay to ensure that the OS is ready to notify us. | ||
await setTimeout(common.platformTimeout(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same is done in other fs.watch()
tests, for example:
node/test/parallel/test-fs-watch-recursive-add-file.js
Lines 41 to 44 in c6316f9
// Do the write with a delay to ensure that the OS is ready to notify us. | |
setTimeout(() => { | |
fs.writeFileSync(testFile, 'world'); | |
}, common.platformTimeout(200)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this deserves a TODO to investigate why this is occuring and whether or not this is a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There already an open issue (#52601) linked in the commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
lgtm
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60060 +/- ##
==========================================
- Coverage 88.45% 88.45% -0.01%
==========================================
Files 703 703
Lines 207826 207826
Branches 40030 40038 +8
==========================================
- Hits 183842 183826 -16
+ Misses 15973 15972 -1
- Partials 8011 8028 +17 🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Add a delay before writing the files to ensure that the watcher receives the notifications. Fixes: nodejs#60051 Refs: nodejs#52601
d3b5d31
to
dfdbb39
Compare
Rebased, this needs new approvals. |
Add a delay before writing the files to ensure that the watcher receives the notifications.
Fixes: #60051
Refs: #52601